package org.webscale.util;


import junit.framework.TestCase;

import org.apache.log4j.Logger;
import org.webscale.util.TagUtil;



public class TestTagUtil extends TestCase {
	private static final Logger log = Logger.getLogger(TestTagUtil.class);
   // Array contains input and expected response
	String[][] testdata = {
			{"LATA Mangeskar","Lata Mangeskar" },
			{"jaTin  Lalit" , "Jatin Lalit" },
			{"Jatin-LaLit" , "Jatin-Lalit"} ,
			{"Ki,shore" ,"Ki,shore"} ,
			{"Life in a   Metro" ,"Life In A Metro"} ,
			{"life in a   metro" ,"Life In A Metro"} ,
			{"A R Rehman" ,"A.R Rehman"} ,
			{"AR Rehman" ,"A.R Rehman"} ,
			{"a r Rehman" ,"A.R Rehman"} ,
		//	{"a.r Rehman" ,"A.R Rehman"} , // TODO : Not working case
		//  {"A.R. Rehman" ,"A.R Rehman"} , // TODO : Not working case
			{"GaDar-2006" ,"Gadar-2006"},
			{"Vishal & Shekhar" ,"Vishal-Shekhar"} ,
			{"Jhoom Barabar   Jhoom" ,"Jhoom Barabar Jhoom"},
			{"Depu59 " ,"Depu59"}
			
	};
	
	
	public void testFormatTag() throws Exception {
		
	   for(int i= 0 ; i < testdata.length ; i ++){
		  String input = testdata[i][0];
		  String expected = testdata[i][1];
		 String result = TagUtil.formatTagForDisplay(input);
	   //   String result = TagUtil.formatTag(input);
	      boolean b = expected.equals(result);
	      super.assertEquals(expected, result);
	      log.info("INPUT = " + input + " EXPECTED = " + expected + " RESULT = " + result + " status=" + b);
	      String[] nms = TagUtil.getFirstLastNameFromFullName(result);
	      log.info("First Name=" + nms[0] + ",Last Name=" + nms[1]);
	      
	   }
	}
	
	
	
}
